﻿#define _CRT_SECURE_NO_WARNINGS 1
//指针变量的类型决定了对指针变量解引用时，能访问多大的空间
#include<stdio.h>
#include<string.h>
//int main()
//{
//	char arr[] = { 'a','b','c','d','e','f' };
//	printf("%zd\n", strlen(*arr));
//	
//
//	return 0;
//}

#include <stdio.h>
//int main()
//{
//	int a[5] = { 1, 2, 3, 4, 5 };
//	int* ptr = (int*)(&a + 1);
//	printf("%d,%d", *(a + 1), *(ptr - 1));
//	return 0;
//}
//int a[] = { 1,2,3,4 };
//printf("%d\n", sizeof(a));
//printf("%d\n", sizeof(a + 0));
//printf("%d\n", sizeof(*a));
//printf("%d\n", sizeof(a + 1));
//printf("%d\n", sizeof(a[1]));
//printf("%d\n", sizeof(&a));
//printf("%d\n", sizeof(*&a));
//printf("%d\n", sizeof(&a + 1));
//printf("%d\n", sizeof(&a[0]));
//printf("%d\n", sizeof(&a[0] + 1));


//在X86环境下
//假设结构体的⼤⼩是20个字节
//程序输出的结果是啥？
//struct Test
//{
//	int Num;
//	char* pcName;
//	short sDate;
//	char cha[2];
//	short sBa[4];
//}*p = (struct Test*)0x100000;
//// *表示p是一个结构体指针变量，将0x10000这个值强制转换为struct Test*类型后赋值给p
//int main()
//{
//	//printf("%p\n", p + 0x1);//0x100014
//	////0x1转换成10进制后是1
//	////p是结构体指针类型(struct Test*类型)，+1就跳过一个结构体类型(struct Test类型)的长度(20个字节)
//	////10进制的20转换成16进制是0x14
//	//// p + 0x1 = 0x100000 + 0x14=0x100014
//
//	//printf("%p\n", (unsigned long)p + 0x1);//0x100001
//	////p被强制转换为unsigned long类型,则(unsigned long)p + 0x1就是两个十六进制的整数相加
//	////(unsigned long)p + 0x1 = 0x100000 + 0x1 = 0x100001
//
//	//printf("%p\n", (unsigned int*)p + 0x1);//0x100004
//	////0x1转换成10进制后是1
//	////将p强制转换为unsigned int*类型,+1就跳过一个unsigned int类型的长度(4个字节)
//	////10进制的4转换成16进制后是0x4
//	////(unsigned int*)p + 0x1 = 0x100000 + 0x4 = 0x100004
//
//	printf("%zd\n", sizeof(struct Test));
//	return 0;
//}

#include <stdio.h>
int main()
{
	char* c[] = { "ENTER","NEW","POINT","FIRST" };
	char** cp[] = { c + 3,c + 2,c + 1,c };
	char*** cpp = cp;
	printf("%s\n", **++cpp);
	printf("%s\n", *-- * ++cpp + 3);
	printf("%s\n", *cpp[-2] + 3);
	printf("%s\n", cpp[-1][-1] + 1);
	return 0;
}